<?php

namespace App\Traits\Relation;

trait InspectionRelation
{
	/**
	 * 获取巡检图片
	 *
	 * Date: 25/04/2018
	 * @author George
	 * @return \Illuminate\Database\Eloquent\Relations\MorphMany
	 */
	public function images()
	{
		return $this->morphMany(Image::class, 'imagetable');
	}

	/**
	 * 获取巡检记录的节点
	 *
	 * Date: 01/05/2018
	 * @author George
	 * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
	 */
	public function node()
	{
		return $this->belongsTo(Node::class, 'node_id', 'id');
	}
}
